SELECT
<#assign prefixName=' '>
<#if (select_id??)>
${prefixName} T.ID AS "id"
	<#assign prefixName=','>
</#if>
<#if (select_orgId??)>
${prefixName} T.ORG_ID AS "orgId"
	<#assign prefixName=','>
</#if>
<#if (select_permissionId??)>
${prefixName} T.PERMISSION_ID AS "permissionId"
	<#assign prefixName=','>
</#if>
<#if prefixName == ' '>
  T.ID AS "id"
, T.ORG_ID AS "orgId"
, T.PERMISSION_ID AS "permissionId"
</#if>
FROM c1_permission_org T
<#include "whereByCode.ftl">
<#assign prefixName='ORDER BY'>
<#if (order_by_id??)>
${prefixName} T.ID ${order_by_id_value!}
	<#assign prefixName=','>
</#if>
<#if (order_by_orgId??)>
${prefixName} T.ORG_ID ${order_by_orgId_value!}
	<#assign prefixName=','>
</#if>
<#if (order_by_permissionId??)>
${prefixName} T.PERMISSION_ID ${order_by_permissionId_value!}
	<#assign prefixName=','>
</#if>
